<?php
    use User\Model\NiudanModel;
?>
<div class="row">
    <div class="col-lg-12">
        <section class="panel">
            <header class="panel-heading">
                分享设置
            </header>
            <div class="panel-body">
                <form class="form-horizontal" method="post" action="/User/Niudan/share_setting" enctype="multipart/form-data">
                    <input type="hidden" name="id" value="{$id}">
                    <input type="hidden" name="update" value="true">
                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">分享标题</label>
                        <div class="col-lg-6">
                            <input type="text" class="form-control" name="share_title" value="{$niudan['share_title']}">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">分享描述</label>
                        <div class="col-lg-6">
                            <textarea name="share_desc" style="width:540px;height:150px;">{$niudan['share_desc']}</textarea>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">分享链接</label>
                        <div class="col-lg-6">
                            <input type="text" class="form-control" name="share_link" value="{$niudan['share_link']}">
                            <p class="help-block">默认为首页的链接</p>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 col-sm-2 control-label">分享图标</label>
                        <div class="col-lg-6">
                            <img src="{$niudan['share_img']}" style="width:100px;height:100px" data-preview="uploadFile">
                            <input type="file" name="picurl" data-action="uploadFile">
                            <if condition="$niudan.share_img neq null">
                                <input type="hidden" name="picurl" value="{$niudan['share_img']}" data-set="uploadFile">
                            </if>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <button class="btn btn-primary" type="submit" id="submit">提交</button>
                            <button class="btn btn-default" type="button" onclick="history.back(-1);">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </div>
</div>
<script type="text/javascript" src="/Public/js/common.upload.js"></script>
<script type="text/javascript">
    common.upload.img.init();
</script>